<html>
 <head> 
 <title>历史数据训练</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../styles/style.css" type="text/css" />
<link rel="stylesheet" href="../styles/table.css" type="text/css" />
<style type="text/css">
.tablecell td.tit{width:30%;}
</style>
<script src="../script/common.js"></script>
<script>
$import("util.js");
$import("rpc.js");
$import("table_list.js");
$import("html/format.js");
$import("html/form.js");
$import("html/validate.js");
$import("My97DatePicker/WdatePicker.js");

function dataValidation()
{
	var validators = 
	{
		"name": new ruite.form.StringEmptyValidator("训练集名称"),
		"historyDataStartTime": new ruite.form.DateValidator("历史数据开始时间"),
		"historyDataEndTime": new ruite.form.DateValidator("历史数据结束时间")
	};
	if (!ruite.form.validate($("train_form"), validators)) return false;

	var beginDate=document.getElementById("historyDataStartTime").value;
	var endDate=document.getElementById("historyDataEndTime").value;
	if(!ruite.form.compareDate(beginDate,endDate))
	{
		alert("终止日期不能早于起始日期！");
		return false;
	}
	
	return true;
}

function onTrain()
{
	if (!dataValidation()) return false;
	var callback = function(data)
	{
		alert("训练完毕！");
		location.href = "train_result_list.jsp";
	}
	var trainSet = {};
	var parsers = 
    {
    	"historyDataStartTime": ruite.parse.date,
        "historyDataEndTime": ruite.parse.date
    };
	trainSet = ruite.form.encode($("train_form"), parsers);

	//训练开始，禁用“开始训练”的按钮，显示等待的图片和提示
	//$('trainButton').style.display = "none";
	//$('loadingSapn').style.display = "";
	
	var opration = new Operation("排班.预测.话务量.训练"); 
	opration.trainSet = trainSet;
	opration.execute(callback);
	
}

function onLoad()
{
	var callback = function(data)
	{
		var projectList = [];
		projectList = data.projectList;

		dwr.util.removeAllOptions('projectId');
		dwr.util.addOptions('projectId', projectList, "id", "name");
	}

	var operation = new Operation("排班.预测.获取预测页面公用显示信息");
	operation.execute(callback);
}

var option_titles = new Array(
	'被人误会或错怪',
	'受人歧视冷遇',
	'考试失败或是不理想',
	'与同学或好友发生纠纷',
	'生活习惯（饮食、休息等）明显变化',
	'不喜欢上学',
	'恋爱不顺利或失恋',
	'长期远离家人不能团聚',
	'学习负担重',
	'与老师关系紧张',
	'本人患极重病',
	'亲友患极重病',
	'亲友死亡',
	'被盗或丢失东西',
	'当众丢面子',
	'家庭经济困难',
	'家庭内部矛盾',
	'预期的评优落空',
	'受批评或处分',
	'转专业或休学',
	'被罚款',
	'升学或考研压力',
	'与人打架',
	'被父母打骂',
	'家庭给你施加学业压力',
	'意外惊吓或事故'
);

var radios = new Array('未发生','没有影响','轻度影响','中度影响','重度影响','极重影响');
</script>
 </head>
<body onLoad="">

<div id="ur_here"><img src="../images/icon_here.gif" style="align:absmiddle"/> 当前位置：首页 » 在线考试 </div>
<div id="wrap">
<div id="containaer">

			<div class="title">试题4</div>
			<div id="tab_content_0" class="tab_content" style="">
			
				<table cellpadding=0 cellspacing=0 border=0 width="100%" class="form_table">
					<tr class='tablecell'>
						<td class="tit">题目：</td>
						<td>最近12个月内 ，你是否经历过以下事件？</td>
					</tr>
					<script type="text/javascript">
					for(var i in option_titles){
						document.write('<tr class="tablecell">');
						document.write('<td class="tit" width="200px">' + option_titles[i] + '</td>');
						document.write('<td>');
						for(var j in radios){
							document.write('<label><input type="radio" id="ques[2]['+i+']" name="ques[2]['+i+']" value="'+j+'" />'+radios[j]+'</label>');
						}
						document.write('</td>');
						document.write('</tr>');
					}
					</script>
				</table>

				<div class="bottom_buttons">
					<button type="button" class="normal">下一题</button>
				</div>
				
				<fieldset class="tips">
					<legend>操作提示:</legend>
					<ul>
						<li>根据题目选择您认为正确的答案</li>
						<li>点击“下一题”继续答题</li>
					</ul>
				</fieldset>
			</div>
			
</div></div>
</body>
</html>
 